﻿using System.Configuration;

namespace Needle.Core.Configuration
{

    /// <summary>
    /// Defines a list of services.
    /// </summary>
    public class ServiceElementCollection : NeedleElementCollection  
    {
  
        /// <summary>
        /// Create a new element.
        /// </summary>
        protected override ConfigurationElement CreateNewElement()
        {
            return new ServiceElement();
        }

        /// <summary>
        /// gets the key of the property element (the name).
        /// </summary>
        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((ServiceElement)element).Type;
        }

        /// <summary>
        /// The name of the item xml element.
        /// </summary>
        protected override string ElementName
        {
            get
            {
                return Element.Service;
            }
        }

    }
}
